package com.sc.common.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import java.io.Serial;
import java.util.List;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sd_route")
public class RouteEntity extends AbstractBaseEntity{

    @Serial
    private static final long serialVersionUID = 1L;

    private Long pid;
    private Integer type;
    private Integer openType;
    private String title;
    private String icon;
    private String route;
    private String powerRoute;
    private Integer weigh;


    /**
     * 路由打开方式枚举
     */
    @AllArgsConstructor
    @Getter
    public enum RouteTypeEnum implements IEnum{

        LEFT_MENU(1, "左侧菜单"),
        PAGE_OPERATION(2, "页面操作"),
        HEADER_MENU(3, "头部菜单");

        private final Integer value;
        private final String desc;

        public static List<Map<String, Object>> getEnumList() {
            return IEnum.getEnumList(RouteTypeEnum.values());
        }
    }

    /**
     * 路由打开方式枚举
     */
    @AllArgsConstructor
    @Getter
    public enum RouteOpenTypeEnum implements IEnum{

        DEFAULT(1, "默认"),
        BROWSER(2, "浏览器"),
        WINDOW(3, "弹窗");

        private final Integer value;
        private final String desc;

        public static List<Map<String, Object>> getEnumList() {
            return IEnum.getEnumList(RouteOpenTypeEnum.values());
        }
    }
}

